//package com.per.mybootall.quartzJob.service;
//
//import cn.hutool.core.date.DateUtil;
//import com.per.mybootall.quartzJob.DynamicJob;
//import com.per.mybootall.quartzJob.DynamicSchedulerFactory;
//import com.per.mybootall.quartzJob.IssuedInformJob;
//import org.quartz.SchedulerException;
//import org.springframework.stereotype.Service;
//
//import java.util.Calendar;
//import java.util.Date;
//import java.util.Map;
//import java.util.UUID;
//
///**
// * Created with IntelliJ IDEA.
// *
// * @author: yyy
// * Date: 2022/6/6
// * Time: 14:17
// * Description:
// */
//@Service
//public class TextQuartzJob {
//
//    public void testJob() throws SchedulerException {
//        DynamicJob job = new DynamicJob(UUID.randomUUID().toString())
//                .cronExpression(getCronStr())
//                .target(IssuedInformJob.class)
//                .addJobData("prefix", 99);
//        //DynamicSchedulerFactory.removeJob(job);
//        DynamicSchedulerFactory.registerJob(job);
//    }
//
//
//    private String getCronStr() {
//        //Date time = DateUtil.toDate(map.get("issuedTime").toString(), "yyyy-MM-dd HH:mm:ss");
//        Calendar calendar = Calendar.getInstance();
//        calendar.setTime(new Date());
//        int hour = calendar.get(Calendar.HOUR_OF_DAY);
//        int second = calendar.get(Calendar.SECOND);
//        int minute = calendar.get(Calendar.MINUTE);
//        int day = calendar.get(Calendar.DAY_OF_MONTH);
//        int month = calendar.get(Calendar.MONTH) + 1;
//        int year = calendar.get(Calendar.YEAR);
//        return second + " " + minute + " " + hour + " " + day + " " + month + " ? " + year;
//    }
//}
